<include file="Common:minheader" />
<form class="layui-form" action="" id="cheform" >
	<input type="hidden" name="id" value="{$usersInfo.id}">
	<div class="layui-form-item">
		<label class="layui-form-label" style="width:auto">会员名称</label>
		<div class="layui-input-block">
			<input type="text" value="{$usersInfo.username}" readonly required  lay-verify="required" autocomplete="off" class="layui-input">
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label" style="width:auto">会员积分</label>
		<div class="layui-input-block">
			<input type="text" value="{$usersInfo.integral}" readonly required  lay-verify="required" autocomplete="off" class="layui-input">
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label" style="width:auto">类型：</label>
		<div class="layui-input-block">
			<select name="type" lay-verify="required" lay-filter="auitSelect">
				<option value="">请选择</option>
				<option value="1">增加</option>
				<option value="2">减少</option>
			</select>
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label" style="width:auto">积分</label>
		<div class="layui-input-block">
			<input type="text" name="integral" required  lay-verify="required" autocomplete="off" class="layui-input">
		</div>
	</div>
	<div class="layui-form-item">
		<div class="layui-input-block">
			<button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
			<button type="reset" class="layui-btn layui-btn-primary">重置</button>
		</div>
	</div>
</form>			
<script>
	layui.use('form', function(){
		var form = layui.form;
		form.on('submit(formDemo)', function(data){
			var cont = $('#cheform').serialize();
			$.ajax({
				url:"{:U('Users/updateUserIntegral')}",
				type:'post',
				dataType:'json',
				data:cont,
				success:function(data){
					if(data.code==0){
						layer.alert(data.message);
					}else{
						layer.alert(data.message, function(index){
							//do something
							window.parent.location.reload();
							var index = parent.layer.getFrameIndex(window.name); 
							parent.layer.close(index);
						});
					}
				}
			});
			//layer.msg(JSON.stringify(data.field));
			return false;
		});
	});
</script>
<!-- /. PAGE INNER  -->
<include file="Common:footer" />